import { Inputform } from './../../shared/from/form-input';
import { Selectform } from './../../shared/from/form-select';
import { FormBase } from './../../shared/from/form-base';
import { Injectable } from '@angular/core';

@Injectable()
export class FormService {

    getItemOfForm() {
        let items: FormBase<any>[] = [

            new Selectform({
                key: 'frequencyTypes',
                label: '定频/变频',
                options: [
                    { value: '定频', label: '定频' },
                    { value: '变频', label: '变频' },
                ],
                marginLeft: 8,
                order: 2
            }),
            new Selectform({
                key: 'kyjTypes',
                label: '空压机类型',
                options: [
                    { value: '离心式', label: '离心式' },
                    { value: '无油螺杆', label: '无油螺杆' },
                    { value: '活塞式', label: '活塞式' },
                    { value: '涡旋式', label: '涡旋式' },
                    { value: '喷油螺杆', label: '喷油螺杆' }
                ],
                marginLeft: -2,
                order: 1,
            }),
            new Selectform({
                key: 'coolingTypes',
                label: '冷却类型',
                options: [
                    { value: '风冷', label: '风冷' },
                    { value: '水冷', label: '水冷' },
                ],
                marginLeft: 10,
                order: 3
            }),

            new Inputform({
                key: 'serie',
                label: '设备系列',
                value: null,
                required: false,
                marginLeft: 14,
                order: 4
            }),

            new Inputform({
                key: 'gas',
                label: '产气量',
                addOnAfter: 'm³/h',
                marginLeft: 22,
                order: 5
            })
        ];

        return items.sort((a, b) => a.order - b.order);
    }
}
